package edu.zju.gis.dbfg.server.service.impl;

import com.github.pagehelper.PageHelper;
import edu.zju.gis.dbfg.common.Page;
import edu.zju.gis.dbfg.common.base.BaseServiceImpl;
import edu.zju.gis.dbfg.server.mapper.ExternalDataSourceMapper;
import edu.zju.gis.dbfg.server.model.ExternalDataSource;
import edu.zju.gis.dbfg.server.service.ExternalDataSourceService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExternalDataSourceServiceImpl extends BaseServiceImpl<ExternalDataSourceMapper, ExternalDataSource, String> implements ExternalDataSourceService {
    @Override
    public Page<ExternalDataSource> search(String userId,Page page) {
        PageHelper.startPage(page.getPageNo(), page.getPageSize());
        return new Page<>(this.mapper.search(userId));
    }

    @Override
    public int insert(ExternalDataSource externalDataSource) {
        return this.mapper.insert(externalDataSource);
    }

    @Override
    public ExternalDataSource searchById(String id) {
        return this.mapper.searchById(id);
    }
    @Override
    public  int deleteByPrimaryKey(String id){
        return  this.mapper.deleteByPrimaryKey(id);
    }
}
